{% extends "base_blank.volt" %}

{% block pageFooter%}
    <script type="text/javascript">
        var bpId = {{ info.beauty_parlor_id }};
        var domainPic = '{{ this.di.get('appConfig').application.domainPic }}';
        var urlEditorPT = '{{ url.get('tools/editorPT') }}';
        var urlPbServiceList = '{{ url.get('bpservice/list') }}';
        
    </script>
    {{ javascript_include("/assets/manage/js/editor_pt_view.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.config.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/ueditor.all.min.js", false) }}
    {{ javascript_include("/libs/UEditor/utf8-php/lang/zh-cn/zh-cn.js", false) }} 
    {{ javascript_include("/assets/manage/js/bp/updateService.js", false) }}
    <script>
    UE.getEditor('editor');
    </script>
{% endblock %}

{% block content %}
<div class="container-fluid" id="content_box_blank">
    <div class="row">
        <div class="col-xs-12">
            <ol class="breadcrumb">
                <li>美容院管理</li>
                <li class="active">更新美容院服务项目</li>
                <li class="active pull-right"><button type="button" onclick="history.back()" class="btn btn-primary btn-xs"><i class="fa fa-chevron-left"></i> 返回</button></li>
            </ol>

            <form id="form_update" class="form-horizontal" role="form" method="post" action="" target="ifr_send_file" enctype="multipart/form-data">
                <input type="hidden" name="callback" value="parent.setFormResult">
                <input type="hidden" name="service_id" value="{{ id }}">
                <div class="form-group">
                    <label for="service_name" class="col-xs-2 control-label">服务名称</label>
                    <div class="col-xs-9">
                        <input type="text" class="form-control" id="service_name" name="service_name" value="{{ info.service_name|escape_attr }}" data-rule="required;">
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_cover" class="col-xs-2 control-label">封面</label>
                    <div class="col-xs-9">
                        <div id="box_cover_show">
                            <img src="{{ PicUrlBPCover(info.service_cover, this.di) }}@!90" />
                            <button type="button" class="btn btn-warning btn-xs but_update" id="but_cover_update"><i class="fa fa-pencil"></i></button>
                        </div>
                        <p class="help-block">*支持JPG，PNG，JPEG格式的图片，大小不超过1M，尺寸为：750X350px</p>
                        <div class="row hide" id="box_cover_update"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_description" class="col-xs-2 control-label">服务简介</label>
                    <div class="col-xs-9">
                        <input type="text" class="form-control" id="service_description" name="service_description" data-rule="required;" value="{{ info.service_description|escape_attr }}">
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_price" class="col-xs-2 control-label">价格</label>
                    <div class="col-xs-2">
                        <div class="input-group">
                            <input type="text" class="form-control" id="service_price" name="service_price" data-rule="required;decimal;" data-target="#service_price_error" value="{{ info.service_price }}">
                            <div class="input-group-addon">元</div>
                        </div>
                    </div>
                    <div class="col-xs-7">
                        <div id="service_price_error"></div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_unit" class="col-xs-2 control-label">单位</label>
                    <div class="col-xs-2">
                        <input type="text" class="form-control" id="service_unit" name="service_unit" value="{{ info.service_unit|escape_attr }}">
                    </div>
                    <div class="col-xs-7">
                        <p class="help-block pull-left">* 可为空，用于价格显示，例如：180元/瓶，这里就应该填写“瓶”</p>
                    </div>
                </div>

                <div class="form-group">
                    <label for="service_is_sell" class="col-xs-2 control-label">是否销售</label>
                    <div class="col-xs-9">
                        <div class="radio">
                            <label>
                                <input type="radio" name="service_is_sell" id="service_is_sell_1" value="1" checked="checked" {{ info.service_is_sell == 1 ? 'checked="checked"' : '' }}> 是
                            </label>
                            <label>
                                <input type="radio" name="service_is_sell" id="service_is_sell_0" value="0" {{ info.service_is_sell == 0 ? 'checked="checked"' : '' }}> 否
                            </label>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label for="service_intro" class="col-xs-2 control-label">详细介绍</label>
                    <div class="col-xs-9">
                        <!-- <div id="box_intro_view" class="hide"></div>
                        <input type="hidden" class="form-control" id="service_intro" name="service_intro" data-rule="required;" data-target="#service_intro_error" value="{{ info.service_intro|escape_attr }}">
                        <button type="button" class="btn btn-primary btn-sm hide" id="but_intro_add"><i class="fa fa-plus"></i> 添 加</button>
                        <button type="button" class="btn btn-primary btn-sm" id="but_intro_update"><i class="fa fa-pencil"></i> 修 改</button>
                        <div class="input-group" id="service_intro_error"></div> -->
                        <textarea id="editor" data-rule="required;" name="service_intro"  style="width:800px; height:400px;">{{ info.service_intro}}</textarea>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-xs-12 text-center">
                        <button type="submit" class="btn btn-primary"><i class="fa fa-floppy-o fa-lg"></i> 保 存</button>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

{% endblock %}